<div class="view" style="width:100%;">
    <h2><?php echo 'Tải dữ liệu lên máy chủ';?></h2>
</div>
<div class="formsearch" style="width:100%;margin:0 auto;display: inline;" align="center">    	
    	<?php echo  $form->create('GhiNhanTaiLen', array('action'=>'index', 'type' => 'file')); ?>
    		<table border="0" cellpadding="5" cellspacing="5" style="background-color:#e8edff;border: 0px solid #b9c9fe;border-collapse:collapse;">
    			<tr>
    				<td><b>Chọn đường dẫn tập tin</b></td>
    				<td>
    					<?php
    						echo $fileUpload->input(array('var'=>'file', 'model'=>false, 'label' => false));
    					?>
    				</td>
    			</tr>
    			<tr>
    				<td colspan="2" align="center">
                        <input type="submit" name="Submit" value="Tải lên">				 
    				</td>
    			</tr>
    		</table>
    	<?php echo $form->end();?>   
</div>
<br clear="both"/>
<div class="view">
<p>
<?php
	$paginator->options(array('url'=>$this->passedArgs));
    echo $paginator->counter(array(
                'format' => 'Bạn đã tải lên %count% lần - Trang %page%/%pages%'
            ));
?></p>
<table cellpadding="0" cellspacing="0" style="width:100%;">
<thead>
	<tr>
		<th class="left" align="center" style="width:7%;"><?php echo 'STT';?></th>		
		<th align="left" style="width:30%;"><?php echo $paginator->sort('Tên tập tin','GhiNhanTaiLen.ten_tap_tin_client');?></th>
		<th align="center" style="width:10%;"><?php echo $paginator->sort('Độ lớn (KB)','GhiNhanTaiLen.do_lon_tap_tin');?></th>
		<th align="center" style="width:20%;"><?php echo $paginator->sort('Kiểu','GhiNhanTaiLen.kieu_tap_tin');?></th>		
        <th align="center" style="width:20%;"><?php echo $paginator->sort('Thời điểm tải','GhiNhanTaiLen.thoi_diem_thay_doi');?></th>
		<th class="right" align="center"><?php echo 'Tình trạng';?></th>
	</tr>
</thead>
<tfoot>
	<tr>
		<td colspan="5" class="left"></td>
		<td class="right"></td>
	</tr>
</tfoot>
<?php
$i = 1;
foreach ($files as $file):
?>
	<tr>
		<td align="center">
			<?php echo $i++; ?>
		</td>		
		<td>
			<?php echo $file['GhiNhanTaiLen']['ten_tap_tin_client']; ?>
		</td>
		<td align="center">
			<?php
                $size = (int)$file['GhiNhanTaiLen']['do_lon_tap_tin'];
                $size = $size/1024.0;
                echo round($size, 2);//$file['GhiNhanTaiLen']['do_lon_tap_tin']; 
            ?>
		</td>
		<td>
			<?php echo $file['GhiNhanTaiLen']['kieu_tap_tin']; ?>
		</td>        
		<td align="center">
			<?php echo $file['GhiNhanTaiLen']['thoi_diem_thay_doi']; ?>
		</td>
        <td align="center">
			<?php
                if($file['GhiNhanTaiLen']['tinh_trang'] == 1){
                    echo 'Thành công';
                }else{
                    echo 'Thất bại';
                }
            ?>
		</td>	
	</tr>
<?php endforeach; ?>
</table>
<div class="paging">
	<?php echo $paginator->prev('<< trước', array(), null, array('class'=>'disabled'));?>
 | 	<?php echo $paginator->numbers();?>
	<?php echo $paginator->next('sau >>', array(), null, array('class' => 'disabled'));?>
</div>
</div>